package showtime.framework.component.loading
{
	import flash.display.Sprite;
	import flash.events.Event;

	/**
	 * @project Client
	 * @date 2011-7-19
	 * @author 绿豆蛙
	 * 
	 */
	public class ProgressSprite extends Sprite
	{
		protected var backgroundColor:uint = 0x000000;
		
		public function ProgressSprite()
		{
			addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
			addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);
		}
	
		protected function addedToStageHandler(evt:Event):void
		{
			removeEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
			
			graphics.beginFill(backgroundColor);			
			graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
			graphics.endFill();

		}
		
		protected function removedFromStageHandler(evt:Event):void
		{
			removeEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);
			
			while (numChildren > 0)
			{
				removeChildAt(0);
			}
		}
		
		public function progress(evt:GroupLoaderEvent):void
		{	
		
		}
	}
}